<%@page import='uiux4.SessionData' %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<title>login.jsp</title>
	<link rel='stylesheet' type='text/css' href='./css/main.css'>
	<script src='./js/login.js'></script>
</head>

<jsp:useBean id="sd" class="uiux4.SessionData" scope="session"/>
<script>

</script>
<body>
<%
	if(sd.getMid()==null || sd.getMid().equals(""))
	{
%>
		<%--세션에 데이터를 저장하기 전 폼--%>
		<form id='login_form' method='post'>
			<label>id : </label>
			<input type='text' name='mid' id='mid' size=9 style='background-color:#ff70f3'>
			<br>
			<label>pw : </label>
			<input type='password' name='pw' id='pw' size=9 style='background-color:#ff70f3'>
			<input type='hidden' name='url' id='url'>
			
			<center><input type=button id='loginBtn' value='Login'></center>
			<a href='./jsp/find_id.jsp' target='_blank'><label>아이디/암호 찾기</label></a>
		</form>
		<script>LogIn();</script>
<%
	}
	else
	{
%>
		<%--세션에 데이터가 저장된 후 폼--%>
		<form id='logout_form' method='post'>
			<%=sd.getMid() %>님 방가<br>
			<input type=button id='logoutBtn' value='Logout'>
			<input type='hidden' name='url' id='url' size=7>
			<input type='hidden' name='flag' id='flag' value='logout'>
			<br>
			<a href='./jsp/member_modify.jsp' target='_blank'><label>정보수정</label></a><br>
			<a href='./jsp/my_message.jsp' target='_blank'><label>미확인메세지</label></a><br>
		</form>
		<script>LogOut();</script>
<%
	}
%>
</body>
</html>